home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr48 / 386p_200.zip / 386FILE.INC < prev    next >
Text File  |  1994-10-31  |  3KB  |  93 lines

  1.         
  2.  
  3. ; This module uses the space between
  4. ; _LoMemBase and lomemtop for buffering file transferts
  5. ; and the space between
  6. ; _HiMemBase and  _HiMemTop to store loaded files
  7.  
  8. extrn _FOpen: near
  9. ;Opens a file and returns its handle into V86bx
  10. ; In:
  11. ;   ESI -> ASCIIZ filename (IN LOW MEMORY)
  12. ;   AL  == file mode: 00 = Read Only
  13. ;                     01 = Write Only (create it if it doesn't exist)
  14. ; Out:
  15. ;   if carry set then Error opening file
  16. ;   else       File opened succesfully
  17. ;              V86bx = file handle
  18.         
  19. extrn _FClose: near
  20. ; Closes file with handle V86bx
  21. ; In:
  22. ;   V86bx = file handle
  23.  
  24. extrn _FSeek: near
  25. ; Seeks position in file
  26. ; In:
  27. ;   V86bx = file handle
  28. ;   EAX   = signed offset to move to
  29. ;   DL    = from: 0-beginning of file, 1-current location, 2-end of file
  30. ; Out:
  31. ;   if carry set then Error seeking in file, eax trashed
  32. ;   else        Seek done
  33. ;               EAX = new offset from beginning of file
  34.  
  35. extrn _FSize: near
  36. ; Get size of file
  37. ; In:
  38. ;   V86bx = file handle
  39. ; Out:
  40. ;   if carry set then Error checking file, eax trashed
  41. ;   else        File exist
  42. ;               EAX = size of file
  43.  
  44. extrn _FRead: near
  45. ; Reads a block from a file with handle V86bx
  46. ; In:   V86bx = file handle
  47. ;       EDI   = base address of block ( relative offset)
  48. ;       EAX   = size of block 
  49. ; Out:  If carry clear
  50. ;       The space between _LoMemBase and _LoMemTop is used as a 
  51. ;       "transition buffer"
  52.         
  53. extrn _FLoad: near
  54. ; Loads a file with ASCIIZ name pointed by DS:ESI (located in low mem)
  55. ; Out:  If carry clear
  56. ;       EAX = file size
  57. ;       The file gets loaded starting from _HiMemBase
  58. ;       The space between _LoMemBase and _LoMemTop is used as a 
  59. ;       "transition buffer"
  60. ;       N.B. _LoMemBase and _HiMemBase are left as they were
  61. ;            BEFORE calling _FLoad, what will you do with the heaps
  62. ;            is up to you.
  63.  
  64. extrn _LoFLoad: near
  65. ; Loads a file with ASCIIZ name pointed by DS:ESI (located in low mem)
  66. ; Out:  If carry clear
  67. ;       EAX = file size
  68. ;       The file gets loaded starting from _LoMemBase
  69. ;       N.B _LoMemBase and _HiMemBase are left as they were
  70. ;           BEFORE calling _LoFLoad, it's up to you to decide to update 'em
  71. ;           or "discard" the load.
  72.  
  73.  
  74.         
  75. extrn _FWrite: near
  76. ; Writes a block of memory to file with handle V86bx
  77. ; In:   V86bx = file handle
  78. ;       esi   = buffer base (relative address)
  79. ;       eax   = file size
  80. ; Out:  If carry clear
  81. ;       file write done
  82.  
  83. extrn _FSave: near
  84. ; Saves a block of memory 
  85. ; into the file with ASCIIZ name 
  86. ; In:
  87. ;       esi = ptr to asciiz file name in low memory
  88. ;       edi = buffer base
  89. ;       eax = file size
  90. ; Out:  If carry clear
  91. ;       file write done
  92.  
  93.